package com.sihai.ehr.service;

import com.sihai.core.Limit;
import com.sihai.core.LimitedList;
import com.sihai.core.Sorter;
import com.sihai.ehr.model.biz.AuditingBase;
import com.sihai.ehr.model.biz.Duty;
import com.sihai.ehr.model.sys.Resource;
import com.sihai.ehr.model.sys.User;
import com.sihai.ehr.web.pojo.StaffSearchPojo;
import com.sihai.ehr.web.pojo.UserSetupPojo;

import java.util.List;

public interface UserService {

    /**
     * 添加用户账号
     * @param user
     */
    public void saveUser(User user);

    /**
     * 查找用户账户信息
     * @param search
     * @param state
     * @param limit
     * @param sorter
     * @return
     */
    public LimitedList<UserSetupPojo> findUserByid(StaffSearchPojo search,final String state, Limit limit, Sorter sorter);

    public UserSetupPojo getUserById(Long id);

    /**
     * 用户更改密码
     * @param pojo
     */
    public String updateUser(UserSetupPojo pojo);

    public void removeUser(String userIds);

    LimitedList<User> findByTopOrganizations(Long organizationId, Limit limit, Sorter sorter) throws Exception;

    boolean isExistByUserName(String account)throws Exception;
    boolean isExistByWorkId(Long workid)throws Exception;
    User getUser(Long id);
    User getByLoginName(String loginName)throws Exception;
    //得到用户可访问权限
    List<Resource> findUserAuthorities(Long userId)throws Exception;

    Duty findUpDuty(Duty baseDuty, List<? extends AuditingBase> auditProcess, AuditingBase currentAuditNode);
}
